#ifndef UAVS_SERIALIZER_H
#define UAVS_SERIALIZER_H

#include "serializer.h"
#include "common/settings.h"
#include "mvc/model/aircrafts/aircraft.h"
#include "common/exceptions.h"

#include <QFile>

class Aircraft_Serializer : public Serializer
{
public:
    Aircraft_Serializer();
    virtual void write_points_to_datfiles(const QString &path, const Configuration *c) throw(Serializer_exception);
    virtual time_zone *read_wake_zones(const QString &path, int time, double scale) throw(Serializer_exception);
    virtual void read_coefficients_loadfiles(const QString &path, const QString &file,
                                             QVector<QString> *coefficients);
    virtual void read_loadsfiles(const QString &path, const QString &file,
                                 QMap<QString, QVector<double>> *c_values) throw(Serializer_exception);
private:
    QString get_value_line(QString parameter,  QString line);
    void write_ls_datfile(const QString &path, const Aircraft *air) throw (Serializer_write_exception);
    void write_fuselage_datfile(const QString &path, const Aircraft *air) throw (Serializer_write_exception);
    void write_vtail_datfile(const QString &path, const Aircraft *air) throw (Serializer_write_exception);
    void write_htail_datfile(const QString &path, const Aircraft *air) throw (Serializer_write_exception);
    void write_points(const QString &path, const QString &datfile, QVector<Point3D *> points) throw (Serializer_write_exception);
    void write_info(const QString &path, const QString &datfile, const QVector<QString> &info,
                    QIODevice::OpenMode mode) throw (Serializer_write_exception);
    QVector<QString> make_header(const AGeometry &, bool panels_info = false) const;
};

#endif // UAVS_SERIALIZER_H
